#ifndef SCREEN_H
#define SCREEN_H
/*
 operator new and delete overloading.
 
*/
class Screen{
public:
	/*
		usage: 
			Screen *p=new Screen;
			delete p;
		
	*/
	void * operator new(size_t);//return type must be void*, size_t is automatically caculated by the compiler.
	void operator delete(void *);//return type must be void, first parameter type must be void*
	/*
		the sceond parameter represents the size of the object pointed to by the first parameter.
		its value is initialized automatically by the complier.
		its mainly used in an object-orented class hierarchy.
	*/
	void operator delete(void *, size_t);

	void * operator new[](size_t);
	void operator delete[](void *);

	void * operator new(size_t, Screen* p);//placement new

private:
	Screen* next;
	static Screen* freeStore;
	static const int screenChunk;
};

#endif